-- 判断能否使用道具

-- 判断使用道具的需求
-- @param user      玩家对象
-- @param classId   道具id
return function(user, classId)
    local dbase = PropertyM.query(classId, "dbase") or {};
    local require = dbase["require"] or {};

    -- 判断需求
    for attrib, amount in pairs(require) do
        if type(attrib) == 'number' then
            if ItemM.getAmount(user, attrib) < amount then
                return attrib;
            end
        else
            if user:queryAttrib(attrib) < amount then
                return attrib;
            end
        end
    end

    return true;
end
